import { ArrayNotEmpty, IsArray, isInt, IsInt, IsNotEmpty, IsNumber, IsOptional, IsString, Min } from 'class-validator';
import { Type } from "class-transformer";

export class PageSize {
  @IsNotEmpty()
  @Type(()=> Number)
  @IsInt()
  @Min(1)
  page: number;

  @IsNotEmpty()
  @Type(()=> Number)
  @IsInt()
  @Min(1)
  pageSize: number;
}

export class UserId {
  @IsInt()
  @Min(0)
  @Type(() => Number)
  userId: number;
}

export class DeleteIds {
  @IsArray()
  @ArrayNotEmpty()
  @Type(()=>Number)
  @IsInt({each: true})
  @Min(1,{each: true})
  ids: number[]
}

export class imgDto {
  @IsString()
  @IsNotEmpty()
  name: string

  @IsString()
  @IsNotEmpty()
  url: string
}